/******************************************************************************
 * @File name   :      PackageRedemptionLines.java
 *
 * @Author      :      ANMA
 *
 * @Date        :      Jul 31, 2015
 *
 * @Copyright Notice: 
 * Copyright (c) 2014 DMS, Inc. All  Rights Reserved.
 * This software is published under the terms of the DMS Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * ----------------------------------------------------------------------------
 * Date                         Who         Version         Comments
 * Jul 31, 2015 2:27:27 PM    ANMA      1.0            Initial Version
 *****************************************************************************/
package com.cap.bts.crmdp.dealer.activation.domain;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cap.bts.crmdp.dealer.coupon.domain.Ticket;
import com.cap.bts.framework.common.domain.BaseDomain;

/**
 * 
 */
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name="TM_RAW_PACKAGE_REDEMPTION_LINES")
@AttributeOverrides({
	@AttributeOverride(name="createDate", column=@Column(name="CREATE_DATE", nullable = false)),
	@AttributeOverride(name="createBy", column=@Column(name="CREATE_BY")),
    @AttributeOverride(name="lastUpdateBy", column=@Column(name="LAST_UPDATE_BY")),
    @AttributeOverride(name="lastUpdateDate", column=@Column(name="LAST_UPDATE_DATE"))
})
public class PackageRedemptionLines extends BaseDomain implements Serializable {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Long id;
	
	private Long packageDefId;
	//例如：换油服务
	private String shortName;
	
	private String description;
	//使用次数
	private Integer numberOfUse;	
	//是否需要验证码 Y or N
	private String hasVerificationCode;
	
	private Ticket ticket;

	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}
	/**
	 * @return the packageDefId
	 */
	@Column(name="PACKAGE_DEF_ID")
	public Long getPackageDefId() {
		return packageDefId;
	}
	/**
	 * @param packageDefId the packageDefId to set
	 */
	public void setPackageDefId(Long packageDefId) {
		this.packageDefId = packageDefId;
	}
	/**
	 * @return the shortName
	 */
	@Column(name="SHORT_NAME")
	public String getShortName() {
		return shortName;
	}
	/**
	 * @param shortName the shortName to set
	 */
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	/**
	 * @return the description
	 */
	@Column(name="DESCRIPTION")
	public String getDescription() {
		return description;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @return the numberOfUse
	 */
	@Column(name="NUMBER_OF_USE")
	public Integer getNumberOfUse() {
		return numberOfUse;
	}
	/**
	 * @param numberOfUse the numberOfUse to set
	 */
	public void setNumberOfUse(Integer numberOfUse) {
		this.numberOfUse = numberOfUse;
	}
	/**
	 * @return the hasVerificationCode
	 */
	@Column(name="HAS_VERIFICATION_CODE")
	public String getHasVerificationCode() {
		return hasVerificationCode;
	}
	/**
	 * @param hasVerificationCode the hasVerificationCode to set
	 */
	public void setHasVerificationCode(String hasVerificationCode) {
		this.hasVerificationCode = hasVerificationCode;
	}
	
	@ManyToOne(optional = true, targetEntity = Ticket.class)
	@JoinColumn(name = "TICKET_DEF_ID", referencedColumnName = "ID")
    public Ticket getTicket() {
        return ticket;
    }
    
    public void setTicket(Ticket ticket) {
        this.ticket = ticket;
    }
	
}
